package com.yan.service.impl;

import com.yan.mapper.UserMapper;
import com.yan.pojo.User;
import com.yan.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：Yan Guang
 * @date ：Created in 2020/11/18 16:47
 * @description：
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public void insert(User user) {
        userMapper.insert(user);
    }

    @Override
    public User getByName(String username) {
        User byId = userMapper.getByName(username);
        return byId;
    }

    @Override
    public String find(String username) {
        return userMapper.find(username);
    }

    @Override
    public List<User> list() {
        List<User> list = userMapper.list();
        return list;
    }

    @Override
    public void update(User user) {
        userMapper.update(user);
    }

    @Override
    public void delete(int UserId) {
        userMapper.delete(UserId);
    }
}
